package com.le.tester.javaThink.fifth.chapter18_Str;

/**
 * createTime：2021/8/6 17:21
 * description：使用普通的str连接字符串和stringBuild连接字符串
 */
public class WhitherStringBuilder {
    public String implicit(String[] fields) {
        String result = "";
        for (String strItem : fields) {
            result += strItem;
        }
        return result;
    }

    public String explicit(String[] fields) {
        StringBuilder stringBuilder = new StringBuilder();
        for (String strItem : fields) {
            stringBuilder.append(strItem);
        }
        return stringBuilder.toString();
    }
}
